<script type="text/javascript">
$(document).ready(function()
{
    $(".campaniaslst").change(function()
    {
        var element = $(this);
        var id=element.val();
        var dataString = 'id='+ id;
        $.ajax
        ({
        type: "POST",
        url: "ajax_campania.php",
        data: dataString,
        cache: false,
        success: function(html)
        {
          $(".preview_contenido").html(html);
        }
        });
    });
    $(".canalcomunicacionslst").change(function()
    {
        var element = $(this);
        var id=element.val();
        if(id=="4")
        {
            $('.mostrarocultar').fadeOut(200).show();
        }else
        {
            $('.mostrarocultar').fadeOut(200).hide();
            //var as = el.getElementsByTagName("lstemailcontactos");
        }
    });
});
</script>
<div align="justify" style="font-size:12px; color:#222222; padding: 5px 150px 30px 150px;">        
    <div style="border-bottom: 1px solid #DDD; padding: 8px 0px 0px 0px;">
        <h2 style="font-size:12px; color:#222222;">{$tituloprincipal}</h2>
    </div>
    
   <div>
   <form action="envios.php?do={$dohacer}" method="post" enctype="multipart/form-data" name="campanias" id="campanias">
       <table  align="center" border="0" cellspacing="0" cellpadding="0" width="70%" class="small">
           <tbody>
            <tr>
                <td colspan="2" style="padding:10px 0px 10px 0px">
                   <div align="center">
                    <input title="{$txtboton} [Alt+S]" accesskey="S" class="save" type="submit" name="button" value="{$txtboton}" style="width:100px" onclick="return( formvalidacion());">
                    <input title="Cancelar [Alt+X]" accesskey="X" class="cancel" type="button" name="button" value="Cancelar" style="width:100px" onclick="window.history.back()">
                   </div>
                </td>
            </tr>

            <tr>
                <td colspan="2" class="detailedViewHeader">
                    <b>Informaci&oacute;n del Env&iacute;o</b>
                </td>
            </tr>

            <!-- Added this file to display the fields in Create Entity page based on ui types  -->
            <tr style="height:25px">

                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"></font>C&oacute;digo
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <input readonly="" name="codigo" style="border:1px solid #bababa; width:20%;" type="text" value="{$env_cod}">
                </td>

            </tr>

            <tr style="height:25px">
                <td width="30%" class="dvtCellLabel" align="right">
                    <font color="red"></font>Descripci&oacute;n
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                    <textarea name="descripcion" class="detailedViewTextBox" tabindex="" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" cols="70" rows="2">{$descripcion|utf8_encode}</textarea>
                    <!--<input size="130" type="text" name="titulo" tabindex="" class="detailedViewTextBox" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" style="width:90%;" value="{$titulo|utf8_encode}">-->
                    
                </td>

            </tr>
            <tr style="height:25px">
                <!-- uitype 111 added for noneditable existing picklist values - ahmed -->
                <td width="30%" class="dvtCellLabel" align="right">
                        <font color="red"></font>
                        Canal de Comunicaci&oacute;n
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                <select name="lstcanalcomunicacion" tabindex="" class="canalcomunicacionslst" style="width: 45%;">
                {section name=i loop=$listacanales}
                {if $canalactual eq $listacanales[i].can_cod}
                    <option value="{$listacanales[i].can_cod}" selected="selected">{$listacanales[i].can_nombre|utf8_encode}</option>
                {else}
                    <option value="{$listacanales[i].can_cod}">{$listacanales[i].can_nombre|utf8_encode}</option>
                {/if}
                {/section}
                </select>
                </td>
           </tr>
           <tr style="height:25px">
                <!-- uitype 111 added for noneditable existing picklist values - ahmed -->                
                <td width="30%" class="dvtCellLabel" align="right">
                        <font color="red"></font>
                        Listas de Contactos
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                <div class="mostrarocultar">
                <select name="lstemailcontactos" tabindex="" class="small" style="width: 85%;">
                <option value="NULL" selected="selected">-- Seleccionar Lista E-mail Contactos --</option>
                {section name=i loop=$listacontactos}
                {if $listacontactoactual eq $listacontactos[i].lmc_cod}
                    <option value="{$listacontactos[i].lmc_cod}" selected="selected">{$listacontactos[i].lmc_descripcion|utf8_encode}</option>
                {else}
                    <option value="{$listacontactos[i].lmc_cod}">{$listacontactos[i].lmc_descripcion|utf8_encode}</option>
                {/if}
                {/section}
                </select>
                </div>
                </td>
                
           </tr>
           <tr style="height:25px">
                <!-- uitype 111 added for noneditable existing picklist values - ahmed -->
                <td width="30%" class="dvtCellLabel" align="right">
                        <font color="red"></font>
                        Listas de Empresas
                </td>

                <td width="70%" align="left" class="dvtCellInfo">
                <div class="mostrarocultar">
                
                <select name="lstemailempresas" tabindex="" class="small" style="width: 85%;">
                <option value="NULL" selected="selected">-- Seleccionar Lista E-mail Empresa --</option>
                {section name=i loop=$listaempresas}
                {if $empresaactual eq $listaempresas[i].lme_cod}
                    <option value="{$listaempresas[i].lme_cod}" selected="selected">{$listaempresas[i].lme_descripcion|utf8_encode}</option>
                {else}
                    <option value="{$listaempresas[i].lme_cod}">{$listaempresas[i].lme_descripcion|utf8_encode}</option>
                {/if}
                {/section}
                </select>
                </div>
                </td>

           </tr>
           <tr style="height:25px">
                <!-- uitype 111 added for noneditable existing picklist values - ahmed -->
                <td width="30%" class="dvtCellLabel" align="right">
                        <font color="red"></font>
                        Estado Env&iacute;o
                </td>
                <td width="70%" align="left" class="dvtCellInfo">
                <select name="lstestado" tabindex="" class="small" style="width: 25%;">
                {section name=i loop=$estados}
                {if $estadoactual eq $estados[i].est_cod}
                    <option value="{$estados[i].est_cod}" selected="selected">{$estados[i].est_descripcion|utf8_encode}</option>
                {else}
                    <option value="{$estados[i].est_cod}">{$estados[i].est_descripcion|utf8_encode}</option>
                {/if}
                {/section}
                </select>
                </td>
           </tr>           
           <tr style="height:25px">
                <!-- uitype 111 added for noneditable existing picklist values - ahmed -->
                <td width="30%" class="dvtCellLabel" align="right">
                        <font color="red"></font>
                        Seleccionar Campa&ntilde;a
                </td>

                <td  width="70%" align="left" class="dvtCellInfo">
                <select name="lstcampania" tabindex="" class="campaniaslst" style="width: 85%;">
                <option value="NULL" selected="selected">-- Seleccionar Campa&ntilde;a Publicitaria --</option>
                {section name=i loop=$listacampanias}
                {if $campaniaactual eq $listacampanias[i].cam_cod}
                    <option value="{$listacampanias[i].cam_cod}" selected="selected">{$listacampanias[i].cam_titulo|utf8_encode}</option>
                {else}
                    <option value="{$listacampanias[i].cam_cod}">{$listacampanias[i].cam_titulo|utf8_encode}</option>
                {/if}
                {/section}
                </select>
                </td>
           </tr>           
           <tr style="height:20px">
               <td>&nbsp;</td>
           </tr>
           <tr>
               <td colspan="2" class="detailedViewHeader">
                   <b>Contenido de la Campa&ntilde;a</b>
                </td>
           </tr>
           <tr>
                <td colspan="2">                    
                    <div class="preview_contenido">
                    </div>
                    <!--<textarea name="contenido" id="textarea_contenido" class="contenido" cols="90" rows="40"></textarea>-->
		</td>
           </tr>                                     
            <tr tyle="height:25px"><td>&nbsp;</td>
            </tr>

           <tr style="height:20px">
               <td>&nbsp;</td>
           </tr>

           <!--
           <tr>
               <td colspan="2" class="detailedViewHeader">
                    <b>Informaci&oacute;n Adicional</b>
                </td>
           </tr>

           <tr style="height:25px">

               <td width="20%" class="dvtCellLabel" align="right">
                    <font color="red"></font>Comentario
                </td>

                <td colspan="2">
                    <textarea name="comentario"  class="detailedViewTextBox" tabindex="" onfocus="this.className='detailedViewTextBoxOn'" onblur="this.className='detailedViewTextBox'" cols="90" rows="5">{$comentario|utf8_encode}</textarea>
		</td>
            </tr>

           -->

            <tr>
		<td colspan="2" style="padding:10px 0px 10px 0px">
		<div align="center">
                    <input title="{$txtboton} [Alt+S]" accesskey="S" class="save" type="submit" name="button" value="{$txtboton}" style="width:100px">
                    <input title="Cancelar [Alt+X]" accesskey="X" class="cancel" type="button" name="button" value="Cancelar" style="width:100px" onclick="window.history.back()">
		</div>
		</td>
            </tr>            
	</tbody>       
       </table>
    </form>
    </div>
   
</div>